/**
 * webpack.config/runner
 */

const webpack = require('webpack');
const Promise = require('bluebird');

const webpackProgressBar = require('progress-bar-webpack-plugin');

module.exports = function(cfg) {
    return new Promise((resolve, reject) => {
        let compiler = webpack(cfg);

        compiler.run((err, stats) => {
            if(err) {
                reject(err);

                return;
            }

            resolve(stats);
        });
    });
};
